package main;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;

public class Inspector {
	
	private Class klass;

	public Inspector(Class klass) {
		this.klass = klass;
	}

	public boolean hasPublicMethods() {
		for(Method method : klass.getDeclaredMethods()) {
			if (Modifier.isPublic(method.getModifiers())) {
				return true;
			}
		}
		return false;
	}
	
	public String[] getFieldNames() {
		Field[] fields = klass.getDeclaredFields(); 
		String[] names = new String[fields.length];
		for ( int i = 0; i < fields.length; i++) {
			names[i] = fields[i].getName();
			System.out.println(names[i]);
		}
		return names;
	}
	
	

}
